include // Inspired by https://www.youtube.com/watch?v=3V80-Fm_5Gs // See http://iotic.com/flutomat/ // http://iotic.com/flutomat/#title=6-hole+D5&diamEmb=6.67¢s1=1200&diam1=7¢s2=1000&diam2=8.5¢s3=800&diam3=9¢s4=600&diam4=7¢s5=400&diam5=9¢s6=200&diam6=8¢s7=-498&diam7=5.5¢s8=-599&diam8=11.4561¢s9=-814&diam9=11.0976¢s10=-996&diam10=12.273¢s11=-1200&diam11=9.1133¢s12=-1302&diam12=12.7¢s13=-1509&diam13=0¢s14=NaN&diam14=0¢s15=NaN&diam15=0¢s16=NaN&diam16=0¢s17=NaN&diam17=0¢s18=NaN&diam18=0¢s19=NaN&diam19=0¢s20=NaN&diam20=0¢s21=NaN&diam21=0¢s22=NaN&diam22=0¢s23=NaN&diam23=0¢s24=NaN&diam24=0¢s25=NaN&diam25=0¢s26=NaN&diam26=0¢s27=NaN&diam27=0¢s28=NaN&diam28=0¢s29=NaN&diam29=0¢s30=NaN&diam30=0¢s31=NaN&diam31=0¢s32=NaN&diam32=0¢s33=NaN&diam33=0¢s34=NaN&diam34=0¢s35=NaN&diam35=0¢s36=NaN&diam36=0¢s37=NaN&diam37=0¢s38=NaN&diam38=0¢s39=NaN&diam39=0¢s40=NaN&diam40=0¢s41=NaN&diam41=0¢s42=NaN&diam42=0¢s43=NaN&diam43=0¢s44=NaN&diam44=0¢s45=NaN&diam45=0¢s46=NaN&diam46=0¢s47=NaN&diam47=0¢s48=NaN&diam48=0¢s49=NaN&diam49=0¢s50=NaN&diam50=0¢s51=NaN&diam51=0¢s52=NaN&diam52=0¢s53=NaN&diam53=0¢s54=NaN&diam54=0¢s55=NaN&diam55=0¢s56=NaN&diam56=0¢s57=NaN&diam57=0¢s58=NaN&diam58=0¢s59=NaN&diam59=0¢s60=NaN&diam60=0¢s61=NaN&diam61=0¢s62=NaN&diam62=0¢s63=NaN&diam63=0¢s64=NaN&diam64=0¢s65=NaN&diam65=0¢s66=NaN&diam66=0¢s67=NaN&diam67=0¢s68=NaN&diam68=0¢s69=NaN&diam69=0¢s70=NaN&diam70=0¢s71=NaN&diam71=0¢s72=NaN&diam72=0¢s73=NaN&diam73=0¢s74=NaN&diam74=0¢s75=NaN&diam75=0¢s76=NaN&diam76=0¢s77=NaN&diam77=0¢s78=NaN&diam78=0¢s79=NaN&diam79=0¢s80=NaN&diam80=0¢s81=NaN&diam81=0¢s82=NaN&diam82=0¢s83=NaN&diam83=0¢s84=NaN&diam84=0¢s85=NaN&diam85=0¢s86=NaN&diam86=0¢s87=NaN&diam87=0¢s88=NaN&diam88=0¢s89=NaN&diam89=0¢s90=NaN&diam90=0¢s91=NaN&diam91=0¢s92=NaN&diam92=0¢s93=NaN&diam93=0¢s94=NaN&diam94=0¢s95=NaN&diam95=0¢s96=NaN&diam96=0¢s97=NaN&diam97=0¢s98=NaN&diam98=0¢s99=NaN&diam99=0¢sEnd=0¢s100=NaN&fHoles=6&keyNote=74&keyFT=0&borD=16&walW=1.25&lipCov=0&unitMult=1.0&decPl=1&showSpc=0&showFreqs=0 // Params start // Body inside_diameter = 16; //mm wall_thickness = 1.25; //mm mouthpiece_length = 22; //mm mouthpiece_angle = 45; //deg // Tunings edge_distance = 224;//mm distance from center of edge distance to end of flute extra_tuning_length = 0; //mm extra_tuning_diameter = 0; //mm holes = [[7,159.4],[7.5,139.5],[8,117.3],[6.5,101.2],[9,71.5],[8,44.7]];//[diameter,distance_from_end_of_flute] // Duct edge_length = 5;//mm duct_width=7;//mm edge_angle=60;//deg edge_fine_tune_x = 0.7; //mm until edge is continuous edge_fine_tune_z = 1.3; //mm until the curve is gone from the cylinder mouthpiece_external_cut_width=4;//mm mouthpiece_external_cut_height=10;//mm // Print tolerance = 0.05; //mm clip_plane_size = [100,100,100];//mm resolution = 100; //Calc body_length=mouthpiece_length+edge_distance+edge_length/2+extra_tuning_length; // Params end top_edge_translate_coords = [-inside_diameter/2-wall_thickness+tolerance,-inside_diameter/2-wall_thickness+tolerance,body_length]; duct_ref_translate_coords = [top_edge_translate_coords.x,-duct_width/2,top_edge_translate_coords.z-mouthpiece_length-edge_length]; module clip_angle(){ translate([-inside_diameter/2-wall_thickness*2,-inside_diameter/2-wall_thickness*2,body_length]) rotate([0,mouthpiece_angle,0])cube(clip_plane_size);} difference(){ cylinder(d=inside_diameter+wall_thickness*2-tolerance*2,h=body_length,$fn=resolution); cylinder(d=inside_diameter+tolerance*2,h=body_length,$fn=resolution); clip_angle(); translate(duct_ref_translate_coords) cube([wall_thickness*2,duct_width,mouthpiece_length+edge_length]); translate([-inside_diameter/2+edge_fine_tune_x,duct_ref_translate_coords.y,duct_ref_translate_coords.z]) scale([-1,1,1]) rotate([0,edge_angle,0]) cube([wall_thickness*4,duct_width,mouthpiece_length+edge_length]); translate(duct_ref_translate_coords) translate([0,0,-edge_fine_tune_z]) cube([wall_thickness*2,duct_width,mouthpiece_length+edge_length]); // Holes for (i = [0 : len(holes)-1]){ translate([ 0, 0, extra_tuning_length+holes[i][1] ]) rotate([0,-90,0]) cylinder(d=holes[i][0]-extra_tuning_diameter,h=-top_edge_translate_coords.x,$fn=resolution); } }